﻿namespace WebPacker
{
	using System.Web;
	using System.Web.Routing;

	public class WebPackerRouteHandler : IRouteHandler
	{
		public IHttpHandler GetHttpHandler(RequestContext requestContext)
		{
			return new WebPackerHandler();
		}

		private class WebPackerHandler : IHttpHandler
		{
			public bool IsReusable
			{
				get { return false; }
			}

			public void ProcessRequest(HttpContext context)
			{
				WebPackerRouter.Instance.Process(new HttpContextWrapper(context));
			}
		}
	}
}